package com.atguigu.controller;

import com.atguigu.pojo.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * projectName: com.atguigu
 *
 * @author: 赵伟风
 * description:
 */
@RestController
@RequestMapping("user")
public class UserController {


    /**
     *
     * 1.导入jackson依赖
     * 2.配置增强版本的秘书和经理 <mvc:annotation-driven
     * 3.方法的返回值类型是为java数据
     * 4.方法或者类上添加@ResponseBody 或者 @RestController
     */
    //查询全部的用户信息
    @GetMapping
    public List<User> findList(){
        List<User> list = new ArrayList<User>();
        User user = new User();
        user.setAge(28);
        user.setName("于涛");
        list.add(user);
        System.out.println("UserController.findList");
        return list;
    }

}
